﻿// DateConverter.cs
//

using System;
using System.Globalization;
using System.Windows.Data;

namespace MedLink2011.Core {

    public sealed class DateConverter : IValueConverter {

        #region Implementation of IValueConverter
        object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture) {
            DateTime dt = (DateTime)value;
            return dt.ToLocalTime();
        }

        object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
            DateTime dt = (DateTime)value;
            return dt.ToUniversalTime();
        }
        #endregion
    }
}
